package s63.kong.shop.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class AjaxResult {
    private int code=200;
    private String msg;
    private Object data;

    public static AjaxResult ok(){
        return new AjaxResult();
    }

    public static AjaxResult ok(Object data){
        return new AjaxResult(200,"success",data);
    }

    public static AjaxResult error(int code,String msg){
        return new AjaxResult(code,msg,null);
    }
}
